import request from "@/utils/request";

export const roleList = (params) => {
  return request({
    url: "/v1/rbac/role/list",
    method: "get",
    params,
  });
};

export const createRole = (data) => {
  return request({
    url: "/v1/rbac/role/create",
    method: "post",
    data,
  });
};

export const updateRole = (data) => {
  return request({
    url: "/v1/rbac/role/update",
    method: "post",
    data,
  });
};

export const deleteRole = (data) => {
  return request({
    url: "/v1/rbac/role/delete",
    method: "post",
    data,
  });
};

export const roleActionList = (params) => {
  return request({
    url: "/v1/rbac/role/action/list",
    method: "get",
    params,
  });
};

export const bindActions = (data) => {
  return request({
    url: "/v1/rbac/role/action/bind",
    method: "post",
    data,
  });
};
